The following is a brief introduction:The first method is to get the object in js. It is more direct. If a page has multiple IDs, such a long document. getElementBy ("id") must be written each time ")Copy codeThe Code is as follows:Document.
Download: http://www.zhihu.com/question/24702250Queryselectorall What's the difference compared to the following methods?
getElementsByTagName
Getelementsbyclassname
Getelementsbyname
1. The standard
reference URL: http://www.w3cfuns.com/article-5593688-1-1.html Document.queryselector ("body");//Return Body nodedocument.queryselector ("#k");//returns the node with the ID kdocument.queryselector ("#k span");//Returns the first span node under a
One, selectordocument.getElementByIddocument.getElementsByTagNameDocument.getelementsbyclassname (IE9)Document.getelementsbynameDocument.queryselectorDocument.queryselectorallThe difference between the Queryselector and the Getelementby series:1.
Details about DOM in JavaScript and JavaScriptDOM
In order to achieve smooth degradation, backward compatibility, and tag separation, the first thing to do when writing JavaScript code should be necessary testing and checking:Add the following code
Comparison Between Common Javascript CDN and javascriptcdn
[Preface]
Refer to some online articles:
Http://c7sky.com/javascript-libraries-cdn.html
The cdn added in this article updates some databases and the response time.
[Update]
When I
This article mainly introduces the JS game's quick run source code details, provides a more detailed explanation of the game's main processes and principles, along with the complete instance source code, for more information, see the examples in
Copy Code code as follows:
function $$ () {
return selector.findchildelements (document, $A (arguments));
}
This class can be divided into three parts: the first part is based on different browsers to determine what DOM action to
This object does not exist in the help document, but it is indeed the core class of the entire DOM operation. The tool function $ is actually a method to call this class.
The Code is as follows:
Function $ (){Return Selector. findChildElements
Contact Us
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.